package com.ruoyi.omp.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.omp.api.domain.FeFine;
import com.ruoyi.omp.api.factory.RemoteFineFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author: cjie
 * @description: 违约金服务
 * @date: 2021/8/16
 */
@FeignClient(contextId = "remoteFineService", value = ServiceNameConstants.OMP_LIFE_SERVICE, fallbackFactory =
        RemoteFineFactory.class)
public interface RemoteFineService {

    /**
     * 查询对应账单id的最后一条违约金记录
     * @param billId 账单id
     * @return
     */
    @GetMapping(value = "/feFine/listLastFine/{billId}")
    R<FeFine> listLastFine(String billId);

    /**
     * 添加违约金记录
     * @param feFine 违约金记录
     */
    @PostMapping(value = "/feFine/add")
    R addFine(FeFine feFine);

    /**
     * 修改违约金记录
     * @param feFine 违约金记录
     */
    @PostMapping(value = "/feFine/update")
    R updateFine(FeFine feFine);
}
